package experiment.service;


import experiment.dao.UserDaoImpl;
import experiment.model.UserPOJO;


public class UserServiceImpl {
	
	private UserDaoImpl userDaoImpl;
	
    public Boolean login(UserPOJO user) {
    	return userDaoImpl.selectByMap(user);
    }
    
    public Boolean register(UserPOJO user) {
    	UserPOJO userPOJO = new UserPOJO();
    	userPOJO.setEmail(user.getEmail());
    	if(userDaoImpl.selectByMap(userPOJO)) {
    		return false;
    	}else {
        	userDaoImpl.insert(user);
    		return true;
    	}
    }

}
